//
//  XmlParserDelegateMarked.h
//  FleaFinder
//
//  Created by Hieu Le on 4/9/13.
//  Copyright (c) 2013 Kiwiweb. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "Marked.h"
#import "Category.h"

typedef enum {
    MARKED_TAG_ID = 18,
    MARKED_TAG_NAME = 0,
    MARKED_TAG_TYPE = 1,
    MARKED_TAG_FEE_TYPE = 2,
    MARKED_TAG_ROAD = 3,
    MARKED_TAG_CITY = 19,
    MARKED_TAG_DATE_FROM = 4,
    MARKED_TAG_DATE_TO = 5,
    MARKED_TAG_START_AT = 6,
    MARKED_TAG_END_AT = 7,
    MARKED_TAG_DESC = 8,
    MARKED_TAG_CATEGORIES = 9,
    MARKED_TAG_CATEGORY = 10,
    MARKED_TAG_CATEGORY_ID = 20,
    MARKED_TAG_CATEGORY_TITLE = 21,
    MARKED_TAG_CONTACT = 11,
    MARKED_TAG_CONTACT_NAME = 12,
    MARKED_TAG_CONTACT_EMAIL = 13,
    MARKED_TAG_CONTACT_HOMEPAGE = 14,
    MARKED_TAG_CONTACT_TLF = 15,
    MARKED_TAG_CONTACT_FB = 16,
    MARKED_TAG_CONTACT_TWT = 17,
    MARKET_TAG_MARKET_TYPE = 22,
    MARKET_TAG_ZIP = 23,
    MARKET_TAG_STANDE = 24
} MarkedTag;

@interface XmlParserDelegateMarked : NSObject <NSXMLParserDelegate>
{
    Marked *currentMarked;
    Category* currentCategory;
    
    NSString *tagId;
    NSString *tagMarked;
    NSString *tagName;
    NSString *tagType;
    NSString *tagFeeType;
    NSString *tagRoad;
    NSString *tagCity;
    NSString *tagZip;
    NSString *tagDateFrom;
    NSString *tagDateTo;
    NSString *tagStartAt;
    NSString *tagEndAt;
    NSString *tagDesc;
    NSString *tagCategories;
    NSString *tagCategory;
    NSString *tagTitle;
    NSString *tagContact;
    NSString *tagEmail;
    NSString *tagHomepage;
    NSString *tagPhone;
    NSString *tagFacebook;
    NSString *tagTweeter;
    NSString *tagStande;
    
    unichar newLine;
    NSString *plusSign;
    
    BOOL isInsideContactTag;
    BOOL isInsideCategoryTag;
    BOOL isInsideMarketTag;
    
    NSInteger currentTag;
    
    
    NSDateFormatter *dateFormatter;
}

@property Marked* currentMarked;

-(void) parseXMLMarkedInfo: (NSString*) sourceUrl;

@end
